#pragma once

#include <memory>
#include "Containers/Containers.h"
#include "ScriptRuntime/ByteCode/ByteCodeFile.h"

class CByteCodeReader;
class CByteCodeFile;
class CRuntimeScriptFile;

class CByteCodeLoader
{
public:
    CByteCodeLoader();

    void LoadByteCodeFile(std::shared_ptr<CByteCodeFile> InByteCodeFile,const CString& ScriptLibraryName);
protected:

    void LoadFile(std::shared_ptr<CByteCodeReader> InByteCodeFileReader);

    void LoadClassContent(std::shared_ptr<CByteCodeReader> InByteCodeFileReader, CType * InClass ,uint32_t InClassEndByte);


    //TVector<std::shared_ptr<CScriptNamespace>> AllNamespaces;
    //TVector<std::shared_ptr<CGSharpNameScope>> AllScopes;

    TVector<std::shared_ptr<CRuntimeScriptFile>> AllScriptFiles;

    //TVector<std::function<void()> > DeferredClasses;

    //TMap<CType* , TVector<std::function<void()>> > DeferredFunctions;

    //TVector<std::function<void()> > DeferredFunctions;

    CString ScriptLibraryName;
};